package com.spring_mysql_redis.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.spring_mysql_redis.entity.Dynamic;
import com.spring_mysql_redis.entity.UserDynamic;
import com.spring_mysql_redis.entity.Users;
import com.spring_mysql_redis.model.ResultFormat;

public interface DynamicService extends IService<Dynamic> {
    /**
     * 全查询动态信息
     *
     * @return
     */
    public IPage<Dynamic> selectDynamicList(Dynamic dynamic, Integer page, Integer limit);

    /**
     * 全查询动态信息
     *
     * @return
     */
    public Page<UserDynamic> selectUserDynamicList(Page<UserDynamic> userDynamic);

    /**
     * 根据用户ID查询动态信息
     *
     * @return
     */
    public Page<UserDynamic> selectOneUserDynamicList(Page<UserDynamic> userDynamic,Integer userId);



    /**
     * 查询动态
     *
     * @param id
     * @return
     */
    Dynamic selectDynamicOne(Integer id, Users user);

    /**
     * 添加动态
     *
     * @param dynamic
     * @return
     */
    ResultFormat saveDynamic(Dynamic dynamic);

    /**
     * 修改动态
     *
     * @param dynamic
     * @return
     */
    Integer updateDynamic(Dynamic dynamic);

    /**
     * 删除动态
     *
     * @param id
     * @return
     */
    Integer deleteDynamicId(Integer id,Integer userId);

}
